from django.urls import path

from .views import IndexView
from . import views_route
from . import views_device
from . import views_account

app_name = 'system'
urlpatterns = [
    path('index/', IndexView.as_view(), name='index'),

    # 路由器
    path('route/', views_route.RouteView.as_view(), name='route'),  # 路由列表视图
    path('route/list/', views_route.RouteListView.as_view(), name='route-list'),  # 获取数据
    path('route/bind/', views_route.RouteBindView.as_view(), name='route-bind'),  # 详细
    path('route/update/', views_route.RouteUpdateView.as_view(), name='route-update'),  # 更新（绑定、解绑服务器）
    path('route/delete/', views_route.RouteDeleteView.as_view(), name='route-delete'),  # 删除设备
    path('route/check_mac/', views_route.RouteStatusView.as_view(), name='check-mac-online'),  # 检查设备是否在线
    path('route/name/update/', views_route.RouteNameUpdateView.as_view(), name='route-name-update'),  # 修改路由器名称
    path('route/detail/', views_route.RouteDetailView.as_view(), name='route-detail'),  # 路由器详情

    # 设备
    path('device/', views_device.DeviceView.as_view(), name='device'),
    path('device/list/', views_device.DeviceListView.as_view(), name='device-list'),
    path('device/name/update/', views_device.DeviceUpdateNameView.as_view(), name='device-update-name'),  # 修改设备名称
    path('device/account2line/', views_device.DeviceAccount2LineView.as_view(), name='device-account-line'),  # 绑定线路

    # 账户管理
    path('account/apply/', views_account.AccountApplyView.as_view(), name='account-apply'),  # 申请账户
    path('account/account2line/', views_account.Account2LineView.as_view(), name='account-account2line'),  # 账户关联线路
    path('account/', views_account.AccountView.as_view(), name='account'),  # 账户
    path('account/list/', views_account.AccountListView.as_view(), name='account-list'),  # 账户列表
    path('account/cancel/', views_account.AccountCancelAuditView.as_view(), name='account-cancel'),  # 撤销审核
    path('lines/list/', views_account.LineListView.as_view(), name='line-list'),  # 账户线路
    path('account/create/', views_account.AccountCreateView.as_view(), name='account-create'),  # 创建账户
]
